package com.qianbao.qianbaobusiness.ui.push;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.androidbase.base.BaseActivity;
import com.androidbase.utils.StatusBarHelper;
import com.qianbao.qianbaobusiness.R;

public class PushMsgDetailActivity extends BaseActivity {

    View toolbar_back;
    TextView toolbar_title;
    TextView tv_msg_title;
    TextView tv_msg_content;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_push_msg_detail;
    }

    @Override
    protected void setupView() {
        StatusBarHelper.translateStatusBar(this);
        toolbar_back = findViewById(R.id.toolbar_back);
        toolbar_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        toolbar_title = findViewById(R.id.toolbar_title);
        tv_msg_title = findViewById(R.id.tv_msg_title);
        tv_msg_content = findViewById(R.id.tv_msg_content);
    }

    @Override
    protected void setupData(Bundle savedInstanceState) {
        Intent intent = getIntent();
        Bundle bundle = intent.getExtras();
        String title = bundle.getString("title");
        String msgTitle = bundle.getString("msg_title");
        String msgContent = bundle.getString("content");
        if (!TextUtils.isEmpty(title)) {
            toolbar_title.setText(title);
        }
        if (!TextUtils.isEmpty(msgTitle)) {
            tv_msg_title.setText(msgTitle);
        }
        if (!TextUtils.isEmpty(msgContent)) {
            tv_msg_content.setText(msgContent);
        }
    }

}
